Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add fake-ipa #14

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Conversation

mboukhalfa
Copy link
Member

@mboukhalfa mboukhalfa commented Jul 15, 2024

Add FakeIPA tool.
To run the FakeIPA check this PR on the Dev-Env metal3-io/metal3-dev-env#1450

@metal3-io-bot metal3-io-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 15, 2024
Copy link
Member

@Rozzii Rozzii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
Please don't forget to add the documentation and the docker file.

@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Rozzii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 15, 2024
@mboukhalfa mboukhalfa force-pushed the Add-fake-ipa/mohammed branch 12 times, most recently from 89cc32e to d6aa256 Compare July 17, 2024 08:00
@Rozzii
Copy link
Member

Rozzii commented Jul 17, 2024

/cc @elfosardo

Copy link
Member

@elfosardo elfosardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't finish reading it all, left some comments to start

fake-ipa/Dockerfile Outdated Show resolved Hide resolved
fake-ipa/Dockerfile Outdated Show resolved Hide resolved
fake-ipa/Run-env/01-vm-setup.sh Outdated Show resolved Hide resolved
fake-ipa/Run-env/01-vm-setup.sh Outdated Show resolved Hide resolved
@mboukhalfa mboukhalfa force-pushed the Add-fake-ipa/mohammed branch 3 times, most recently from 2e52de1 to df4ddcf Compare July 22, 2024 12:49
Copy link
Member

@mquhuy mquhuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially found this error, but perhaps something else is wrong as my test didn't pass. Will come back with more reviews

fake-ipa/fake_ipa/main.py Show resolved Hide resolved
Copy link
Member

@dtantsur dtantsur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us create a new repository. utility-images is for, well, utility images, and this is a larger project that can be useful outside of Metal3 even.

@mboukhalfa
Copy link
Member Author

Let us create a new repository. utility-images is for, well, utility images, and this is a larger project that can be useful outside of Metal3 even.

For now, our priority is to merge the Sushy tools patch. Let's close that long-running case there first, where we still get questions about the use case. That's the thing that really confounds me, wondering if even the Ironic community will make any use of that, rather than outside communities.

Copy link
Member

@mquhuy mquhuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions and questions

fake-ipa/conf.py Show resolved Hide resolved
fake-ipa/fake_ipa/main.py Show resolved Hide resolved
app.logger.info("Received system update for %s: %s", system_name, system)

# Check if 'pending_power' is present and not None or empty
if 'pending_power' not in system or not system['pending_power']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this pending_power set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coming from sushy-tools notifications

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you point me to the specific location? I cannot find it anywhere, sushy-tools checks this, sure, but it never sets it.
In my trial, this if case prevents fake-ipa to ever response to any boot request, because pending_power is never set in the request.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding power state you are not supposed to send it directly to fakeIPA but only sushy-tools notify it with some here where it is set in the sushy-tools: https://opendev.org/openstack/sushy-tools/src/commit/c5b64a27e1e7ea1a2e5b7490633353f5649ad297/sushy_tools/emulator/resources/systems/fakedriver.py#L142

@Rozzii
Copy link
Member

Rozzii commented Jul 29, 2024

I just put a hold here, please remove the hold after all the questions have been answered
/hold

@Rozzii
Copy link
Member

Rozzii commented Jul 29, 2024

/hold

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2024
Signed-off-by: Mohammed Boukhalfa <[email protected]>
fake-ipa/Dockerfile Outdated Show resolved Hide resolved
fake-ipa/README.md Outdated Show resolved Hide resolved
fake-ipa/README.md Outdated Show resolved Hide resolved

1. clone the env scripts `cd` inside `fake-ipa/Run-env` folder
2. check configs in `config.py`
3. run init `./Init-environment.sh`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, let's not have the third? forth? place where we have virtual machine initialization code. Fake IPA should be integrated as an option to metal3-dev-env.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid this will add complexity to dev-env and will be hard to understand this is more simple env where we can easily changes and light weight to run

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, but the crux here is whether you're adding something that only you will be able to use and maintain (then why not personal github) or something that community members will be able to use 1 years from this point while you're on vacation.

We already have a bunch of useful scripts in BMO like run_local_ironic.sh that need to be fixed every time someone is trying them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Dmitry. In the long run this setup should be put somewhere it could be maintained and tested. Dev-env is a good place.
I could live with putting the setup here though, but it needs to be improved. The current state is pretty experimental, and difficult to follow. IMO we could just remove the setup part from this PR, and make some PoC PR where you show how it works. We then can improve from that, and make a "proper" setup.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also agree with Dmitry. I was starting to review the scripts and then I realized that I was having a "deja-vu". This should definitely look better in metal3-dev-env, or at least connected to it in some way to avoid duplication, confusion, or even possible conflicts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened a PR to run fakeIPA on the dev-env metal3-io/metal3-dev-env#1450

Copy link
Member

@dtantsur dtantsur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed the full Python code, but I believe I've looked at it enough times. The pressing issues now are:

  1. Fake IPA is not an utility image.
  2. The whole Run-env thing duplicates in parts metal3-dev-env, and our e2e tests, and who knows what else. Let's integrate the new project in metal3-dev-env since that's the place we already have?

fake-ipa/Dockerfile Outdated Show resolved Hide resolved
fake-ipa/README.md Outdated Show resolved Hide resolved
fake-ipa/Run-env/01-vm-setup.sh Outdated Show resolved Hide resolved

1. clone the env scripts `cd` inside `fake-ipa/Run-env` folder
2. check configs in `config.py`
3. run init `./Init-environment.sh`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also agree with Dmitry. I was starting to review the scripts and then I realized that I was having a "deja-vu". This should definitely look better in metal3-dev-env, or at least connected to it in some way to avoid duplication, confusion, or even possible conflicts.

@dtantsur
Copy link
Member

dtantsur commented Aug 5, 2024

FYI sushy-tools 1.3.0 includes the necessary patch.

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the large number of nits, but please configure your editor to lint for you, or run linters manually. Makes reviewing easier when everyone else's editors don't vomit thousand warnings opening up the files.

.gitignore Outdated Show resolved Hide resolved
fake-ipa/Dockerfile Outdated Show resolved Hide resolved
fake-ipa/Dockerfile Outdated Show resolved Hide resolved
fake-ipa/README.md Outdated Show resolved Hide resolved
fake-ipa/README.md Outdated Show resolved Hide resolved
fake-ipa/fake_ipa/main.py Show resolved Hide resolved
fake-ipa/fake_ipa/main.py Outdated Show resolved Hide resolved
fake-ipa/fake_ipa/standby.py Show resolved Hide resolved
fake-ipa/setup.py Show resolved Hide resolved
fake-ipa/setup.cfg Outdated Show resolved Hide resolved
@mboukhalfa
Copy link
Member Author

Let us create a new repository. utility-images is for, well, utility images, and this is a larger project that can be useful outside of Metal3 even.

This was discussed in the 2024-09-04 community meeting, where it was agreed to merge the PR for now, with the option to move it to a dedicated repository later if needed. We can also coordinate the creation of a new repo along with other related work, such as metal3-io/cluster-api-provider-metal3#1610, which could live together with fakeIPA.

@mboukhalfa
Copy link
Member Author

I just put a hold here, please remove the hold after all the questions have been answered /hold

/hold cancel

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 9, 2024
Copy link
Member

@kashifest kashifest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 11, 2024
@dtantsur dtantsur dismissed their stale review September 12, 2024 12:43

I don't like this code placed in utility-images but I promised not to block it.

@metal3-io-bot metal3-io-bot merged commit a4eee8e into metal3-io:main Sep 12, 2024
3 checks passed
@metal3-io-bot metal3-io-bot deleted the Add-fake-ipa/mohammed branch September 12, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants